<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
    //229971308 龚雅丹 第七个
    class Animal {  
			     constructor(name) {  
			         this.name = name;  
			     }  
			   
			     shout() {  
			         console.log(`${this.name} is shouting!`);  
			     }  
			 }  
			 // 派生类 Dog  
			 class Dog extends Animal {  
			     constructor(name, age) {  
			         super(name);  
			         this.age = age;  
			     }  
			     eat() {  
			         console.log(`${this.name} is eating.`);  
			     }  
			 }  
			 let dog = new Dog('小李', 8);  
			 console.log(dog.name); 
			 console.log(dog.age); 
			 dog.shout(); 
			 dog.eat(); 
           
			
    </script>
</body>
</html>